package com.frontop.system.config;

import org.springframework.boot.web.servlet.MultipartConfigFactory;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import javax.servlet.MultipartConfigElement;

/**
 * @author YangBoos
 * @title: MultipartConfig
 * @projectName frontop-cloud
 * @description: 文件上传配置
 * @date 2021/12/17 14:48
 */
@Configuration
public class MultipartConfig {
    @Bean
    public MultipartConfigElement multipartConfigElement() {
        MultipartConfigFactory factory = new MultipartConfigFactory();
        factory.setMaxRequestSize("200MB"); //总大小
        factory.setMaxFileSize("200MB"); // 单个文件
        return factory.createMultipartConfig();
    }
}
